package com.yongbao.model.util;

import com.yongbao.model.dtomapper.DishDtoMapper;
import com.yongbao.model.domain.DishDO;
import com.yongbao.model.vo.DishVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class DishConvert {

    public static List<DishVO> buildDishVoList(List<DishDO> dishDOList) {
        if (CollectionUtils.isEmpty(dishDOList)) {
            return Lists.newArrayList();
        }
        List<DishVO> dishVOList = new ArrayList<>();
        for (DishDO dishDO : dishDOList) {
            dishVOList.add(DishDtoMapper.INSTANCE.do2VO(dishDO));
        }

        return dishVOList;
    }
}
